package com.uu.look.common.core;

import org.springframework.stereotype.Component;
import org.uu.skull.result.ResultCode;

import javax.annotation.PostConstruct;

/**
 * User : LiuKe
 * Date : 2016/12/14
 * Time : 17:10
 */

@Component
public class Code {
    public static final String SUCCESS = "000000";
    public static final String SYSTEM_ERROR = "000001";
    public static final String POWER_ERROR = "000002";
    public static final String ID_NOT_NULL = "000003";
    public static final String SESSION_NO = "000004";

    public static final String COMPANY_NAME_NOT_NULL = "100001";
    public static final String COMPANY_TYPE_NOT_NULL = "100002";
    public static final String COMPANY_TYPE_PATTERN = "100003";
    public static final String COMPANY_ABB_NOT_NULL = "100004";
    public static final String COMPANY_NOT_EXIST = "100005";
    public static final String COMPANY_HAVE_POINT_CAN_NOT_DELETE = "100006";
    public static final String COMPANY_POINT_NOT_EXIST = "100007";
    public static final String COMPANY_NOT_NULL = "100008";
    public static final String COMPANY_POINT_NAME_NOT_NULL = "100009";
    public static final String COMPANY_POINT_SHORT_NAME_NOT_NULL = "100010";
    public static final String COMPANY_POINT_ADDRESS_NOT_NULL = "100011";
    public static final String COMPANY_POINT_NOT_NULL = "100012";
    public static final String COMPANY_SEARCH_TYPE_NOT_NULL = "100013";
    public static final String COMPANY_SEARCH_TYPE_ERROR = "100014";
    public static final String COMPANY_POINT_SEARCH_TYPE_NOT_NULL = "100015";
    public static final String COMPANY_POINT_SEARCH_TYPE_ERROR = "100016";
    public static final String COMPANY_POINT_CODE_NOT_NULL = "100017";
    public static final String COMPANY_TYPE_SEND_CAN_NOT_IN = "100018";

    public static final String USER_CODE_NOT_NULL = "200001";
    public static final String USER_NOT_EXIST = "200002";
    public static final String USER_NAME_NOT_NULL = "200003";
    public static final String PASSWORD_NOT_NULL = "200004";
    public static final String RANDOM_CODE_NOT_NULL = "200005";
    public static final String RANDOM_CODE_ERROR = "200006";
    public static final String USER_NAME_OR_PASSWORD_ERROR = "200007";
    public static final String USER_TRUE_NAME_NOT_NULL = "200008";
    public static final String USER_PHONE_NOT_NULL = "200009";
    public static final String USER_TYPE_ERROR = "200010";
    public static final String USER_TYPE_NOT_NULL = "200011";
    public static final String USER_NAME_FORMAT_ERROR = "200012";
    public static final String USER_PHONE_FORMAT_ERROR = "200013";
    public static final String USER_TRUE_NAME_SIZE_ERROR = "200014";
    public static final String USER_NAME_YET_EXIST = "200015";
    public static final String USER_ID_NOT_NULL = "200016";
    public static final String USER_NOT_SENDER = "200017";
    public static final String USER_OLD_PASSWORD_NOT_NULL = "200018";
    public static final String USER_NEW_PASSWORD_NOT_NULL = "200019";
    public static final String USER_OLD_PASSWORD_ERROR = "200020";
    public static final String USER_NEW_PASSWORD_PATTERN = "200021";

    public static final String TRACKING_NUMBER_NOT_NULL = "300001";
    public static final String TRACKING_STATUS_NOT_NULL = "300002";
    public static final String TRACKING_STATUS_ERROR = "300003";
    public static final String TRACKING_NOT_IN = "300004";
    public static final String TRACKING_COLLECT_TYPE_NOT_NULL = "300005";
    public static final String TRACKING_COLLECT_TYPE_ERROR = "300006";
    public static final String TRACKING_NUMBER_REPEAT= "300007";
    public static final String TRACKING_IN_ONLY_CAN_SEND_OR_BACK_OUT= "300008";
    public static final String TRACKING_SEND_ONLY_CAN_SIGNED_OR_RETURN= "300009";
    public static final String TRACKING_SIGNED_CAN_NOT_CONTINUE= "300010";
    public static final String TRACKING_BACK_OUT_CAN_ONLY_IN= "300011";
    public static final String TRACKING_BACK_CAN_ONLY_BACK_OUT_OR_SEND= "300012";
    public static final String SENDER_CODE_NOT_NULL= "300013";
    public static final String TRACKING_NUMBER_PATTERN= "300014";
    public static final String SENDER_ID_NOT_NULL= "300015";
    public static final String TRACKING_STATUS_BACK_PROBLEM_NOT_NULL= "300016";
    public static final String TRACKING_STATUS_SIGNED_COLLECT_MONEY_NOT_NULL= "300017";
    public static final String COLLECT_MONEY_CAN_NOT_LOW_ZERO= "300018";
    public static final String TRACKING_NOT_EXIST = "300019";
    public static final String TRACKING_MODIFY_TYPE_NOT_NULL = "300020";
    public static final String TRACKING_MODIFY_TYPE_PATTERN = "300021";
    public static final String TRACKING_MODIFY_COLLECT_NOT_REQUIRE = "300022";
    public static final String TRACKING_STATUS_CANT_NOT_MODIFY_COLLECT_TYPE = "300023";

    public static final String ROLE_NAME_NOT_NULL = "400001";
    public static final String ROLE_NOT_EXIST = "400002";
    public static final String MODULE_ID_NOT_NULL = "400003";
    public static final String FUNCTION_NAME_NOT_NULL = "400004";
    public static final String FUNCTION_REQUEST_URL_NOT_NULL = "400005";
    public static final String FUNCTION_SHORT_NAME_NOT_NULL = "400006";
    public static final String ROLE_ID_NOT_NULL = "400007";


    //将返回代码与信息说明存入skull框架的ResultCode中，便于自动生成Result
    @PostConstruct
    public void init() {

        ResultCode.put(SUCCESS, "成功");
        ResultCode.put(SYSTEM_ERROR, "系统错误");
        ResultCode.put(POWER_ERROR, "权限不足");
        ResultCode.put(ID_NOT_NULL, "ID不能为空");
        ResultCode.put(SESSION_NO, "session已失效，请重新登录");

        ResultCode.put(COMPANY_NAME_NOT_NULL, "公司名称不能为空");
        ResultCode.put(COMPANY_TYPE_NOT_NULL, "公司类型不能为空");
        ResultCode.put(COMPANY_TYPE_PATTERN, "公司类型错误");
        ResultCode.put(COMPANY_ABB_NOT_NULL, "公司英文缩写不能为空");
        ResultCode.put(COMPANY_NOT_EXIST, "公司不存在");
        ResultCode.put(COMPANY_HAVE_POINT_CAN_NOT_DELETE, "有站点的公司不能删除");
        ResultCode.put(COMPANY_POINT_NOT_EXIST, "站点不存在");
        ResultCode.put(COMPANY_NOT_NULL, "所属公司不能为空");
        ResultCode.put(COMPANY_POINT_NAME_NOT_NULL, "站点全称不能为空");
        ResultCode.put(COMPANY_POINT_SHORT_NAME_NOT_NULL, "站点简称不能为空");
        ResultCode.put(COMPANY_POINT_ADDRESS_NOT_NULL, "站点地址不能为空");
        ResultCode.put(COMPANY_POINT_NOT_NULL, "站点不能为空");
        ResultCode.put(COMPANY_SEARCH_TYPE_NOT_NULL, "公司列表的查询类型不能为空");
        ResultCode.put(COMPANY_SEARCH_TYPE_ERROR, "公司列表的查询类型有误");
        ResultCode.put(COMPANY_POINT_SEARCH_TYPE_NOT_NULL, "站点列表的查询类型不能为空");
        ResultCode.put(COMPANY_POINT_SEARCH_TYPE_ERROR, "站点列表的查询类型有误");
        ResultCode.put(COMPANY_POINT_CODE_NOT_NULL, "站点编号不能为空");
        ResultCode.put(COMPANY_TYPE_SEND_CAN_NOT_IN, "入仓站点类型不能为跑腿公司");

        ResultCode.put(USER_CODE_NOT_NULL, "用户编号不能为空");
        ResultCode.put(USER_NOT_EXIST, "用户不存在");
        ResultCode.put(USER_NAME_NOT_NULL, "用户名不能为空");
        ResultCode.put(PASSWORD_NOT_NULL, "密码不能为空");
        ResultCode.put(RANDOM_CODE_NOT_NULL, "验证码不能为空");
        ResultCode.put(RANDOM_CODE_ERROR, "验证码错误，请重新输入");
        ResultCode.put(USER_NAME_OR_PASSWORD_ERROR, "用户名或密码错误，请重新输入");
        ResultCode.put(USER_TRUE_NAME_NOT_NULL, "用户真实姓名不能为空");
        ResultCode.put(USER_PHONE_NOT_NULL, "用户手机号码不能为空");
        ResultCode.put(USER_TYPE_ERROR, "用户类型错误");
        ResultCode.put(USER_TYPE_NOT_NULL, "用户类型不能为空");
        ResultCode.put(USER_NAME_FORMAT_ERROR, "用户名格式错误");
        ResultCode.put(USER_PHONE_FORMAT_ERROR, "手机号格式有误");
        ResultCode.put(USER_TRUE_NAME_SIZE_ERROR, "真实姓名长度为2-6个字符");
        ResultCode.put(USER_NAME_YET_EXIST, "用户名已存在");
        ResultCode.put(USER_ID_NOT_NULL, "用户ID不能为空");
        ResultCode.put(USER_NOT_SENDER, "该用户不是派件员用户");
        ResultCode.put(USER_OLD_PASSWORD_NOT_NULL, "原密码不能为空");
        ResultCode.put(USER_NEW_PASSWORD_NOT_NULL, "新密码不能为空");
        ResultCode.put(USER_OLD_PASSWORD_ERROR, "原密码错误");
        ResultCode.put(USER_NEW_PASSWORD_PATTERN, "新密码格式为6-18位字母数字任意组合");

        ResultCode.put(TRACKING_NUMBER_NOT_NULL, "运单号不能为空");
        ResultCode.put(TRACKING_STATUS_NOT_NULL, "运单状态不能为空");
        ResultCode.put(TRACKING_STATUS_ERROR, "运单状态有误");
        ResultCode.put(TRACKING_NOT_IN, "该运单号未入仓");
        ResultCode.put(TRACKING_COLLECT_TYPE_NOT_NULL, "运单代收类型不能为空");
        ResultCode.put(TRACKING_COLLECT_TYPE_ERROR, "运单代收类型错误");
        ResultCode.put(TRACKING_NUMBER_REPEAT, "重复的运单号");
        ResultCode.put(TRACKING_IN_ONLY_CAN_SEND_OR_BACK_OUT, "状态为已入库的运单，只能执行派件或退件操作");
        ResultCode.put(TRACKING_SEND_ONLY_CAN_SIGNED_OR_RETURN, "状态为派件中和再次派件的运单，只能执行签收或返仓操作");
        ResultCode.put(TRACKING_SIGNED_CAN_NOT_CONTINUE, "状态为已签收的运单，不能执行任何操作");
        ResultCode.put(TRACKING_BACK_OUT_CAN_ONLY_IN, "状态为已退件的运单，仅可执行入库操作");
        ResultCode.put(TRACKING_BACK_CAN_ONLY_BACK_OUT_OR_SEND, "状态为已返仓的运单，只能执行退件或派件操作");
        ResultCode.put(SENDER_CODE_NOT_NULL, "派送人编号不能为空");
        ResultCode.put(TRACKING_NUMBER_PATTERN, "运单号格式有误");
        ResultCode.put(SENDER_ID_NOT_NULL, "派送人ID不能为空");
        ResultCode.put(TRACKING_STATUS_BACK_PROBLEM_NOT_NULL, "问题描述为必填项");
        ResultCode.put(TRACKING_STATUS_SIGNED_COLLECT_MONEY_NOT_NULL, "到付单签收时必须填写代收金额");
        ResultCode.put(COLLECT_MONEY_CAN_NOT_LOW_ZERO, "代收金额不能小于0");
        ResultCode.put(TRACKING_NOT_EXIST, "运单不存在");
        ResultCode.put(TRACKING_MODIFY_TYPE_NOT_NULL, "运单修改类型不能为空");
        ResultCode.put(TRACKING_MODIFY_TYPE_PATTERN, "运单修改类型错误");
        ResultCode.put(TRACKING_MODIFY_COLLECT_NOT_REQUIRE, "当前运单类型即为您要修改的运单类型，无需再次修改");
        ResultCode.put(TRACKING_STATUS_CANT_NOT_MODIFY_COLLECT_TYPE, "已签收的运单不能修改运单类型");

        ResultCode.put(ROLE_NAME_NOT_NULL, "角色名称不能为空");
        ResultCode.put(ROLE_NOT_EXIST, "角色不存在");
        ResultCode.put(MODULE_ID_NOT_NULL, "模块ID不能为空");
        ResultCode.put(FUNCTION_NAME_NOT_NULL, "功能名称不能为空");
        ResultCode.put(FUNCTION_REQUEST_URL_NOT_NULL, "功能请求地址不能为空");
        ResultCode.put(FUNCTION_SHORT_NAME_NOT_NULL, "功能简称不能为空");
        ResultCode.put(ROLE_ID_NOT_NULL, "角色ID不能为空");
    }
}
